##############################
#   Skill   
#   by Jerry Yang      
#   UUZ0218            
#############################
import random
import  time

def SkillName():
    head = random.randint(0xb0, 0xf7)
    body = random.randint(0xa1, 0xfe)
    val = f'{head:x} {body:x}'
    str = bytes.fromhex(val).decode('gb2312')
    return str

def SkillWay():
    way = ['拳','掌','剑法','刀法','绝技','大法','神功','气功','脚','枪法','天地','阴阳','灭']
    name = random.choice(way)
    return name

def SkillNameAll():
    str = SkillName()+SkillName()+SkillWay()
    return str

def SkillInf(inf,Skill):
    SkillName = SkillNameAll()
    AdventuresLevel = inf['Level']
    Skill[SkillName] = {
            'SkillMagic':random.randrange(1,50),
            'SkillAttack':random.randrange(1,50)*AdventuresLevel,
    }
    print('Congratulations! You get ' + SkillName)
    time.sleep(1)
    return Skill

def get_SkillInformation(Skill):
    for na,inf in Skill.items():
        print('\nname:'+na)
        SkillMagic = inf['SkillMagic']
        SkillAttack = inf['SkillAttack']
        print('\tSkillMagic:' + str(SkillMagic))
        print('\tSkillAttack:' + str(SkillAttack))
        time.sleep(1)



